<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>注册_{$site.shop_title}</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta content="A fully featured admin theme which can be used to build CRM, CMS, etc."
		name="description" />
		<meta content="Coderthemes" name="author" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<link rel="shortcut icon" href="{$site.ico}" />
		<link href="/content/template/common/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
		<link href="/content/template/common/css/icons.min.css" rel="stylesheet" type="text/css" />
		<link href="/content/template/common/css/app.min.css" rel="stylesheet" type="text/css" />
		<link href="/assets/libs/toastr/toastr.css" rel="stylesheet" type="text/css" />
		{:doAction('register_head')}
		<style>
		    .card {
                margin-bottom: 24px;
                -webkit-box-shadow: 0 0.5rem 1.01rem rgb(75 75 90 / 36%);
                /* box-shadow: 0 0.5rem 1.01rem rgb(75 75 90 / 36%); */
                border-radius: .25rem;
            }
		</style>
	</head>
	<body class="authentication-bg">
		<div class="account-pages" style="padding-top: 50px;">
			<div class="container">
				<div class="row justify-content-center">
					<div class="col-xl-6">
						<div class="card register">
							<div class="card-body p-0">
								<div class="row">
									<div class="col-md-12 p-5">
										<div class="mx-auto mb-5">
											<a href="{:url('/')}" title="返回首页">
												<img src="/content/template/common/picture/logo.png" alt="" height="24" />
												<h3 class="d-inline align-middle ml-1 text-logo">{$site.shop_pet_name} - 注册</h3>
											</a>
										</div>
										<!--<h6 class="h5 mb-0 mt-4">注册账号!</h6>-->
										<p class="text-muted mt-1 mb-4">注册一个免费的账号并开始使用{$site.shop_pet_name}</p>
										<div>
											<div class="form-group">
												<label class="form-control-label">
													账号
												</label>
												<div class="input-group input-group-merge">
													<div class="input-group-prepend">
														<span class="input-group-text">
															<i class="icon-dual" data-feather="mail">
															</i>
														</span>
													</div>
													<input type="text" class="form-control" id="account" placeholder="手机号/邮箱">
												</div>
											</div>
											<div class="form-group mt-4">
												<label class="form-control-label">
													密码
												</label>
												<div class="input-group input-group-merge">
													<div class="input-group-prepend">
														<span class="input-group-text">
															<i class="icon-dual" data-feather="lock">
															</i>
														</span>
													</div>
													<input type="password" class="form-control" id="password" placeholder="请输入密码">
												</div>
											</div>
											<div class="form-group mt-4">
												<label class="form-control-label">
													确认密码
												</label>
												<div class="input-group input-group-merge">
													<div class="input-group-prepend">
														<span class="input-group-text">
															<i class="icon-dual" data-feather="lock">
															</i>
														</span>
													</div>
													<input type="password" class="form-control" id="repassword" placeholder="请输入密码">
												</div>
											</div>
											<div class="form-group mb-4">
											    <div class="custom-control custom-checkbox">
											        <input type="checkbox" class="custom-control-input" id="checkbox-signup" checked="">
											        <label class="custom-control-label" for="checkbox-signup">
											            <font style="vertical-align: inherit;"><font style="vertical-align: inherit;">我接受</font></font>
											            <a href="javascript: void(0);"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">条款和条件</font></font></a>
											        </label>
											     </div>
											</div>
											<div class="form-group mb-0 text-center">
												<button class="btn btn-primary btn-block" type="submit" id="register-btn">注册</button>
											</div>
										</div>
										<!--<div class="py-3 text-center">
											<span class="font-size-16 font-weight-bold">
												Or
											</span>
										</div>
										<div class="row">
											<div class="col-6">
												<a href="" class="btn btn-white">
													<i class='uil uil-google icon-google mr-2'>
													</i>
													With Google
												</a>
											</div>
											<div class="col-6 text-right">
												<a href="" class="btn btn-white">
													<i class='uil uil-facebook mr-2 icon-fb'>
													</i>
													With Facebook
												</a>
											</div>
										</div>-->
									</div>
									<!--<div class="col-lg-6 d-none d-md-inline-block">
										<div class="auth-page-sidebar">
											<div class="overlay">
											</div>
											<div class="auth-user-testimonial">
												<p class="font-size-24 font-weight-bold text-white mb-1">
													I simply love it!
												</p>
												<p class="lead">
													"It's a elegent templete. I love it very much!"
												</p>
												<p>
													- Admin User
												</p>
											</div>
										</div>
									</div>-->
								</div>
							</div>
							<!-- end card-body -->
						</div>
						<!-- end card -->
						<div class="row mt-3">
							<div class="col-12 text-center">
								<p class="text-muted">
									已有帐号？
									<a href="{:url('/login')}" class="text-primary font-weight-bold ml-1">
										去登录
									</a>
								</p>
							</div>
							<!-- end col -->
						</div>
						<!-- end row -->
					</div>
					<!-- end col -->
				</div>
				<!-- end row -->
			</div>
			<!-- end container -->
		</div>
		<!-- end page -->
		<!-- Vendor js -->
		<script src="/content/template/common/js/vendor.min.js"></script>
		<!-- App js -->
		<script src="/content/template/common/js/app.min.js"></script>
		<script src="/assets/libs/toastr/toastr.js"></script>
		<script>
		    toastr.options = {
		        "positionClass" : "toast-top-right"
		    }

		    $("#register-btn").click(function(){
		        var account = $('#account').val();
		        var password = $('#password').val();
		        var repassword = $('#repassword').val();
		        if(account == ''){
		            toastr.error('账号不能为空');
		            return;
		        }
		        if(password == ''){
		            toastr.error('密码不能为空');
		            return;
		        }
		        if(password.length < 6){
		            toastr.error('密码不能小于6位');
		            return;
		        }
		        if(password.length > 16){
		            toastr.error('密码不能大于16位');
		            return;
		        }
		        if(password != repassword){
		            toastr.error('两次密码输入不一致');
		            return;
		        }
		        var _this = $(this);
		        if(_this.html() != '注册'){
		            return;
		        }
		        _this.html("注册中");
		        var data = {"account":account, "password":password};
                $.post("{:url('/register')}", data, function(e){

                    if(e.code == 1){
                        toastr.success(e.msg);
                        _this.html("注册成功");
                        history.back();
                    }else{
                        toastr.error(e.msg);
                        _this.html("注册");
                    }
                }, "json");

		    })

		</script>
	</body>

</html>
